import { Component } from '@angular/core';

@Component({
  selector: 'app-demo2',
  templateUrl: './demo2.component.html',
  styles: [`
    span{ background: #eee; width: 40px; height: 20px;}
  `]
})
export class Demo2Component {
  visible = true;
  text = 'Hide';

  change() {
    this.visible = !this.visible
    if(!this.visible){
      this.text = 'Show';
    }else{
      this.text = 'Hide';
    }
  }
}